package cn.xfdzx.android.apps.shop.contract;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.AddAddressBeen;
import cn.xfdzx.android.apps.shop.bean.AddressListBeen;
import cn.xfdzx.android.apps.shop.bean.DeleteAddressBeen;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */

public interface AddressListContract {
    interface Model {
        Flowable<AddressListBeen> initAddressData(String page,String limit);
        Flowable<DeleteAddressBeen> delectAddress(String id);
        Flowable<AddAddressBeen> addAddress(String realname, String mobile, String lng, String lat, String is_default, String address_info, String house_number, String id, String label);

    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onInitSuccess(AddressListBeen bean);
        void onDelectSuccess(DeleteAddressBeen bean,int position);

        void onAddAddressSuccess(AddAddressBeen bean,int position,int index);
        /**
         * 刷新完成
         */
        void finishRefresh();

        /**
         * 加载完成
         */
        void finishLoadMore();
    }

    interface Presenter {
        /**

         */
        void delectAddress (String id,int position);
        void initAddressData(boolean isRefresh, boolean isLoading, String page,String limit);
        void addAddres(int position,int index,String realname, String mobile, String lng, String lat, String is_default, String address_info, String house_number, String id, String label);

    }
}
